unit DAOInterface;

interface

uses  qjson, qlog, System.Generics.Collections;

type
  IDAO<T:class> = interface

    procedure findById(id: integer; data: T);

    procedure findAll(data: TObjectList<T>);

    function save(data: T): integer;
    function update(data: T): integer;
    function deleteById(id: integer): integer;

    procedure find(sql: string; data: TObjectList<T>); overload;
    procedure find(sql: string; const Param: array of variant;
      data: TObjectList<T>); overload;

    function findFirst(sql: string; data: T): integer; overload;
    function findFirst(sql: string; const Param: array of variant;
      data: T): integer; overload;

    procedure excuteSQL(sql: string); overload;
    procedure excuteSQL(sql: string; const Param: array of variant); overload;

    procedure excuteStoreProc(procname: string); overload;
    procedure excuteStoreProc(procname: string;
      const Params: array of variant); overload;

  end;

implementation

end.
